<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"  xmlns:ui="http://java.sun.com/jsf/facelets"                        
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"      >
    <h:head>     
        <link href="#{facesContext.externalContext.requestContextPath}/resources/css/default.css" rel="stylesheet" type="text/css" />
        <link href="#{facesContext.externalContext.requestContextPath}/resources/css/cssLayout.css" rel="stylesheet" type="text/css" />
        <link href="#{facesContext.externalContext.requestContextPath}/resources/css/menu.css" rel="stylesheet" type="text/css" />
        <title>Blue Pumpkin Admin Page</title>
    </h:head>
    <h:body>
        <div class="main_body_admin" >
            <div class="separator_div"/>
            <div class="admin_logo"/>

            <h:form id="frmMain">
                <p:menubar style="text-align: center" >
                    <p:menuitem value="Event" actionListener="#{naviagtionControl.redirectToEventPage()}" > </p:menuitem> 
                    <p:menuitem value="Prize" actionListener="#{naviagtionControl.redirectToPrizePage()}" ></p:menuitem> 
                    <p:menuitem value="User"   actionListener="#{naviagtionControl.redirectToUserPage()}" ></p:menuitem> 
                    <p:menuitem value="FAQ"  actionListener="#{naviagtionControl.redirectToFAQsPage()}" ></p:menuitem> 
                    <p:menuitem value="Contact" style="color: blueviolet; font-weight: bold" styleClass="admin_menu_current"  ></p:menuitem> 
                    <p:menuitem value="Registration" actionListener="#{naviagtionControl.redirectToRegistrationPage()}" ></p:menuitem> 
                    <p:menuitem value="Winner" actionListener="#{naviagtionControl.redirectToWinnerPage()}"  ></p:menuitem> 
                    <p:menuitem value="Comment" actionListener="#{naviagtionControl.redirectToCommentsPage()}"  ></p:menuitem> 
                    <p:submenu label="#{userControl.user.fullName}"    >
                         <p:menuitem value="Edit Profile" actionListener="#{userControl.redirectToLogonUserPage()}" ></p:menuitem> 
                        <p:menuitem value="Log out" actionListener="#{userControl.logout()}"  ></p:menuitem> 
                    </p:submenu>

                </p:menubar>
            </h:form>

            <div class="content_display">
                <h:form>
                    <p:toolbar>
                        <p:toolbarGroup>

                            <p:commandButton value="List Contacts" actionListener="#{contactControl.redirectToListContact()}" />

                        </p:toolbarGroup>
                    </p:toolbar>
                </h:form>
                <p:spacer height="5px" />
                <p:panel style="width: 99%;">
<!--                    <p:ajaxStatus id="pst" onsuccess="statusDialog.show()" oncomplete="statusDialog.hide();statusDialogFn.show(); " />-->
                    <p:dialog modal="false" widgetVar="statusDialog" header="Sending...."   
                              draggable="true" closable="true">  
                        <p:graphicImage value="/resources/images/ajax_loading_bar.gif" />  
                    </p:dialog>  
                    <p:dialog modal="false" widgetVar="statusDialogFn" header="Finish" transient="true"
                              draggable="true" closable="true">  
                        <h:form>
                            <h:panelGrid columns="1">
                                <h:outputText value="Reply has been sent." />
                                <p:spacer height="10px" />
                                <p:commandButton value="OK" onclick="statusDialogFn.hide();" />
                            </h:panelGrid>
                        </h:form>
                    </p:dialog>  
                    <h:form >
                        <p:panel header="Reply Contact">
                            <p:growl id="mgs" autoUpdate="true" />
                            <h:panelGrid columns="2">
                                <h:outputLabel value="To: " />
                                <h:outputText id="reciever" value="#{contactControl.user.fullName}" />
                                <h:outputLabel value="Conent" for="content" />
                                <p:editor id="content" value="#{contactControl.replyContent}" required="true" requiredMessage="Please enter content."  />
                                <p:commandButton  value="Send" actionListener="#{contactControl.sendMail()}" update="@form" />
                                <p:commandButton  value="Cancel" actionListener="#{contactControl.redirectToListContact()}" immediate="true" process="@this" update="@this"/>

                            </h:panelGrid>
                        </p:panel>
                    </h:form>
                </p:panel>

            </div>
        </div>
    </h:body>
</html>
